import request from './request'

export function getBookList(data) {
  return request({
    url: '/book/page',
    method: 'post',
    data
  })
}

export function getBookDetail(id) {
  return request({
    url: `/book/${id}`,
    method: 'get'
  })
}

export function addBook(data) {
  return request({
    url: '/book',
    method: 'post',
    data
  })
}

export function updateBook(data) {
  return request({
    url: '/book',
    method: 'put',
    data
  })
}

export function deleteBook(id) {
  return request({
    url: `/book/${id}`,
    method: 'delete'
  })
} 